<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">











<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>NPanday - Creating a Simple Project</title>
    <style type="text/css" media="all">
      @import url("../../css/maven-base.css");
      @import url("../../css/maven-theme.css");
      @import url("../../css/site.css");
    </style>
    <link rel="stylesheet" href="../../css/print.css" type="text/css" media="print" />
          </head>
  <body class="composite">
    <div id="banner">
                  <a href="" id="bannerLeft">
    
                                            <img src="../.././images/NPanday.png" alt="" />
    
            </a>
                        <a href="http://www.codeplex.com/" id="bannerRight">
    
                                            <img src="../.././images/logo-home.png" alt="" />
    
            </a>
            <div class="clear">
        <hr/>
      </div>
    </div>
    <div id="breadcrumbs">
          
  

  
    
            
  
    
            <div class="xleft">
          
                <a href="http://npanday.codeplex.com/" class="externalLink">NPanday Home</a>
                &gt;
      
                <a href="../../">NPanday 1.2</a>
                  </div>
            <div class="xright">      
  

  
    
            
  
    
             Last Published: 22 Jun 2010
              &nbsp;| Version: 1.2
            </div>
      <div class="clear">
        <hr/>
      </div>
    </div>
    <div id="leftColumn">
      <div id="navcolumn">
           
  

  
    
            
  
    
                   <h5>General Info</h5>
            <ul>
              
    <li class="none">
                    <a href="../../index.html">NPanday Overview</a>
          </li>
              
    <li class="none">
                    <a href="../../release-notes.html">NPanday Release Notes</a>
          </li>
              
    <li class="none">
                    <a href="../../faqs.html">NPanday FAQs</a>
          </li>
              
    <li class="none">
                    <a href="../../faqs.html">NPanday Features</a>
          </li>
              
    <li class="none">
                    <a href="../../npanday.pdf">Documentation PDF</a>
          </li>
          </ul>
              <h5>User's Guide</h5>
            <ul>
              
    <li class="none">
                    <a href="../.././guide/index.html">Introduction</a>
          </li>
              
    <li class="none">
                    <a href="../.././guide/installation/index.html">Installation</a>
          </li>
              
    <li class="none">
                    <a href="../.././guide/vs/index.html">Visual Studio Add-in</a>
          </li>
              
    <li class="none">
                    <a href="../.././guide/maven/index.html">Maven Command Line</a>
          </li>
              
    <li class="none">
                    <a href="../.././guide/devinfra/index.html">Maven Development Infrastructure</a>
          </li>
              
    <li class="none">
                    <a href="../../plugins/index.html">NPanday Plugins</a>
          </li>
          </ul>
              <h5>Contributing</h5>
            <ul>
              
    <li class="none">
                    <a href="../.././developers/index.html">Developer's Guide</a>
          </li>
              
    <li class="none">
                    <a href="../.././issue-tracking.html">Issue Tracking</a>
          </li>
              
    <li class="none">
                    <a href="../.././mail-lists.html">Mailing Lists</a>
          </li>
          </ul>
              <h5>Project Documentation</h5>
            <ul>
              
                
              
      
            
      
            
      
            
      
            
      
            
      
            
      
              
        <li class="collapsed">
                    <a href="../../project-info.html">Project Information</a>
                </li>
          </ul>
              <h5>Resources</h5>
            <ul>
              
    <li class="none">
                    <a href="http://maven.apache.org/" class="externalLink">Apache Maven</a>
          </li>
              
    <li class="none">
                    <a href="http://npanday.codeplex.com/" class="externalLink">NPanday on CodePlex</a>
          </li>
          </ul>
                                           <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
            <img alt="Built by Maven" src="../../images/logos/maven-feather.png"></img>
          </a>
                       
  

  
    
            
  
    
        </div>
    </div>
    <div id="bodyColumn">
      <div id="contentBox">
        <div class="section"><h2>Creating a Simple Project</h2>
<p>Before you start this procedure, you must have all <a href="../installation/index.html"> Pre-requisites</a> in place and have successfully completed all steps in the previous section entitled Installing and Verifying NPanday .NET Build Tool.</p>
<p>We will use the Maven Archetype Plugin to generate a skeleton project. It will be created as a subdirectory of the current working directory in the command shell.</p>
<p>Execute the following command to create a C# project:</p>
<div class="source"><pre>mvn archetype:generate -DarchetypeArtifactId=maven-archetype-dotnet-simple -DarchetypeGroupId=npanday \
  -DarchetypeVersion=[version]&gt;&gt;&gt;</pre>
</div>
<p>When prompted, select the co-ordinates for the project that you wish to use, eg:</p>
<ul><li>group ID = <tt>com.example</tt></li>
<li>artifact ID = <tt>Example.Project</tt></li>
<li>version = <tt>1.0-SNAPSHOT</tt></li>
</ul>
<p>The command creates the project in the Example.Project directory, which will now contain the following:</p>
<div class="source"><pre>.
|-- src
| `-- main
|   `-- csharp
|     `-- Sample
|       `-- MyApp.cs
|   `-- resources
| `-- test
|   `-- csharp
`- pom.xml</pre>
</div>
<p>From inside the Solution directory (<tt>Example.Project</tt>), execute the following command to build and install the Example.Project DLL files into your repository:</p>
<p><tt>mvn install</tt></p>
<p>The <tt>mvn install</tt> command typically puts artifacts (installs them) into the repository here, <tt>C:\Documents and Settings\[user_home]\.m2\repository</tt>.</p>
<p>NPanday installs the artifacts in a .NET local repository, located in <tt>C:\Documents and Settings\[user_home]\.m2\uac</tt>.</p>
<p>For the <tt>Example.Project</tt> solution the artifact is placed here, <tt>C:\Documents and Settings\[user_home]\.m2\uac\gac_msil\Example.Project\1.0-SNAPSHOT__com.example\Example.Project.dll</tt></p>
<p>The contents in <tt>C:\Documents and Settings\[user_home]\.m2\uac\gac_msil</tt> SHOULD NOT be manually modified or the project build will fail due to artifacts that are not properly indexed and are not synchronized with the repository. In case the contents have been modified, delete the <tt>C:\Documents and Settings\[user_home]\.m2\uac</tt> directory then re-install the project.</p>
<p>The sample project contains NUnit tests. If the build fails on <tt>nunit-console</tt>, make sure you have NUnit 2.2+ installed and located in the PATH.</p>
<p>You can clean up the target directory and download dependencies by executing:</p>
<p><tt>mvn clean</tt></p>
<div class="section"><h3>Creating other types of projects</h3>
<p>Other types of template projects are available. To use them instead, change the <tt>archetypeArtifactId</tt> option to one of the following:</p>
<ul><li><tt>maven-artchetype-dotnet-simple</tt> - simple C# project with unit tests in the Maven directory layout</li>
<li><tt>maven-artchetype-vb-simple</tt> - simple Visual Basic project with unit tests in the Maven directory layout</li>
<li><tt>maven-artchetype-netexecutable</tt> - simple project for creating a console executable</li>
</ul>
</div>
</div>

      </div>
    </div>
    <div class="clear">
      <hr/>
    </div>
    <div id="footer">
      <div class="xright">&#169;  
          2010
    
          NPanday
          
  

  
    
            
  
    
  </div>
      <div class="clear">
        <hr/>
      </div>
    </div>
  </body>
</html>
